<!DOCTYPE html>
<html>
<head>
    <title>ListTeacher</title>


    <style>
        html, body {
            height: 100%;
        }

        body {
            margin: 0;
            padding: 0;
            width: 100%;
            display: table;
            font-weight: 100;
            font-family: "Segoe UI", "Lucida Grande", Helvetica, Arial, "Microsoft YaHei", FreeSans, Arimo, "Droid Sans", "wenquanyi micro hei", "Hiragino Sans GB", "Hiragino Sans GB W3", Arial, sans-serif;

        }

        .container {
            text-align: center;
            display: table-cell;
            vertical-align: middle;
        }

        .content {
            text-align: center;
            display: inline-block;
        }

        .title {
            font-size: 96px;
        }

        .largetitle {
            font-size: 36px;
            font-weight: bold;
            color: white;
            background-color: #0000C2;

        }
    </style>
</head>
<body>
<div class="container">

    <div class="content">
        <div class="largetitle"><p>教师表</p></div>
        <table>
            <th>职工号</th>
            <th>姓名</th>
            <th>性别</th>
            <th>年龄</th>
            <th>邮政编码</th>
            <th>家庭地址</th>
            <th>电话号码</th>
            <th>所属系</th>
            @foreach ($teachers as $teacher)
                <tr>
                    <td>{{$teacher->tid}}</td>
                    <td>{{$teacher->name}}</td>
                    <td>{{$teacher->sex}}</td>
                    <td>{{$teacher->age}}</td>
                    <td>{{$teacher->address->postcode}}</td>
                    <td>{{$teacher->address->address}}</td>
                    <td>{{$teacher->address->phone}}</td>
                    <td>{{$teacher->department->name}}</td>
                </tr>
            @endforeach

        </table>
    </div>


        <div class="content">
            <div class="largetitle"><p>地址表</p></div>
            <table>
                <th>邮政编码</th>
                <th>家庭地址</th>
                <th>电话号码</th>
                <th>职工号</th>
                <th>姓名</th>
                <th>性别</th>
                <th>年龄</th>

                @foreach ($addresses as $address)
                    <tr>
                        <td>{{$address->postcode}}</td>
                        <td>{{$address->address}}</td>
                        <td>{{$address->phone}}</td>
                        <td>{{$address->teacher->tid}}</td>
                        <td>{{$address->teacher->name}}</td>
                        <td>{{$address->teacher->sex}}</td>
                        <td>{{$address->teacher->age}}</td>
                    </tr>
                @endforeach

            </table>
        </div>


            <div class="content">
                <div class="largetitle"><p>系部表</p></div>
                <table>
                    <th>系部名称</th>
                    <th>负责人</th>
                    <th>说明</th>
                    <th>成员名单</th>


                    @foreach ($departments as $department)
                        <tr>
                            <td>{{$department->name}}</td>
                            <td>{{$department->header->name}}</td>
                            <td>{{$department->memo}}</td>
                            <td>
                                @foreach ($department->teachers as $teacher)
                                    {{$teacher->name}}&nbsp;
                                @endforeach
                            </td>

                        </tr>
                    @endforeach

                </table>
            </div>
        </div>

</body>
</html>
